import { ItemData } from "../../../resource/info/ItemData";
import { EBind } from "../../../../../Message/Public/EBind";
import { ItemInfo } from "../../../resource/info/ItemInfo";
type int = number;
//class TempRefreshData
    
    export  class TempRefreshData
    {
        constructor(arg1: int)
        {
            
            var loc1=new ItemData(arg1);
            if (loc1.itemInfo.item.bind != EBind._EBindNo) 
            {
                this.itemBind = loc1;
            }
            else 
            {
                this.itemUnBind = loc1;
            }
            arg1 = loc1.itemCode;
            return;
        }

        public set itemInfo(arg1: ItemInfo)
        {
            if (!this.itemUnBind && arg1.item.bind == EBind._EBindNo) 
            {
                this.itemUnBind = new ItemData(arg1.item.code);
            }
            else if (!this.itemBind && arg1.item.bind == EBind._EBindYes) 
            {
                this.itemBind = new ItemData(arg1.item.code);
            }
            return;
        }

        public set amount(arg1: int)
        {
            this._amount = arg1;
            return;
        }

        public get amount(): int
        {
            return this._amount;
        }

        public get itemData(): ItemData
        {
            if (this.itemBind) 
            {
                this.itemBind.itemAmount = this.amount;
                return this.itemBind;
            }
            this.itemUnBind.itemAmount = this.amount;
            return this.itemUnBind;
        }

        /* internal */ /* var */_amount: int=0;

        /* internal */ /* var */itemBind: ItemData;

        /* internal */ /* var */itemUnBind: ItemData;

        public /* var */code: int;
    }
